'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.home.index);
  router.post('/login', controller.home.home.login);
  router.post('/loginout', controller.home.home.loginout);
  router.post('/register', controller.home.home.register);

  router.get('/admin', controller.index.admin);
  router.get('/index', controller.index.index);
  
 
  router.get('/admin/api', controller.admin.adminApi.apiList);

  router.get('/admin/group', controller.admin.adminApi.groupAction);
  router.post('/admin/addProject', controller.admin.admin.addProject);
  router.post('/admin/editProject', controller.admin.admin.editProject);

  router.get('/admin/delProject', controller.admin.admin.delProject);

  //添加接口
  router.post('/admin/addApi', controller.admin.adminApi.addApi);
  router.get('/admin/showApi', controller.admin.adminApi.showApi);
  router.post('/admin/updateApi', controller.admin.adminApi.updateApi);
  router.get('/admin/deleteApi', controller.admin.adminApi.deleteApi);
  
  router.post('/admin/addGroup', controller.admin.adminApi.addGroup);
  router.get('/admin/deleteGroup', controller.admin.adminApi.deleteGroup);

  router.get('/index/showApi', controller.home.homeApi.showApi);
  
  router.get('/index/showAction', controller.home.homeApi.showAction);
  
  router.get('/index/sendAction', controller.home.homeApi.sendAction);
  router.post('/index/sendAction', controller.home.homeApi.sendAction);
  
  router.post('/index/authApi', controller.home.homeApi.authApi);
  
  router.post('/index/clearAuth', controller.home.homeApi.clearAuth);
  
  
  
};
